#ifndef NEOTOGGLEBUTTONPRIVATE_H
#define NEOTOGGLEBUTTONPRIVATE_H

#include "def.h"
#include <QPainter>

class QPropertyAnimation;
class QParallelAnimationGroup;
class NeoToggleButton;
class NeoToggleButtonPrivate : public QObject
{
    Q_OBJECT
    NEO_PRIVATE_CREATE(NeoToggleButton)
    NEO_PROPERTY_CREATE(QColor, BackgroundCacheColor)
    NEO_PROPERTY_CREATE(QColor, TextCacheColor)
    NEO_PRIVATE_PROPERTY_CREATE_H(bool, Checked)
    NEO_PRIVATE_PROPERTY_CREATE_H(bool, IsAnimationEnabled)
    NEO_PRIVATE_PROPERTY_CREATE_H(NeoIconType::FontAwesomeSolid, Icon)
    NEO_PRIVATE_PROPERTY_CREATE_H(QString, Text)
    NEO_PRIVATE_PROPERTY_CREATE_H(QColor, NormalBackgroundColor)
    NEO_PRIVATE_PROPERTY_CREATE_H(QColor, CheckedBackgroundColor)
    NEO_PRIVATE_PROPERTY_CREATE_H(QColor, NormalForegroundColor)
    NEO_PRIVATE_PROPERTY_CREATE_H(QColor, CheckedForegroundColor)
public:
    NeoToggleButtonPrivate(QObject *parent = nullptr);
    ~NeoToggleButtonPrivate();

    void startColorAnimation();

    void drawBackground(QPainter *painter);
    void drawIcon(QPainter *painter);
    void drawText(QPainter *painter);

private:
    QPropertyAnimation *pBackgroundColorAnimation;
    QPropertyAnimation *pForegroundColorAnimation;
    QParallelAnimationGroup *pAnimationGroup;
};

#endif